package ch.mueller.android.nmeaexample.util;

import ch.mueller.android.nmeaexample.util.readerFactoryElements.UnknownAnalyser;
import ch.mueller.android.nmeaexample.util.readerFactoryElements.GGAAnalyser;
import ch.mueller.android.nmeaexample.util.readerFactoryElements.GLLAnalyser;
import ch.mueller.android.nmeaexample.util.readerFactoryElements.GPSLineAnalyser;
import ch.mueller.android.nmeaexample.util.readerFactoryElements.GSAAnalyser;
import ch.mueller.android.nmeaexample.util.readerFactoryElements.GSVAnalyser;
import ch.mueller.android.nmeaexample.util.readerFactoryElements.RMCAnalyser;
import ch.mueller.android.nmeaexample.util.readerFactoryElements.VTCAnalyser;

public class GPSLineReaderFactory {

    public GPSLineAnalyser getGpsLineAnalyser(String messageType, String line) {

        if (messageType.equals("GGA")) {
            return new GGAAnalyser(line);
        } else if (messageType.equals("GLL")) {
            return new GLLAnalyser(line);
        } else if (messageType.equals("GSA")) {
            return new GSAAnalyser(line);
        } else if (messageType.equals("GSV")) {
            return new GSVAnalyser(line);
        } else if (messageType.equals("RMC")) {
            return new RMCAnalyser(line);
        } else if (messageType.equals("VTG")) {
            return new VTCAnalyser(line);
        }

        return new UnknownAnalyser(line);
    }

}
